import Vue from 'vue'
import App from './App.vue'
import "./assets/font_1426139_h6vn3jbl5q.css"
// 调用路由
import routes from './router/index';

Vue.config.productionTip = false

// 组件
import {
  Form, Field, Button, Toast,
  Cell, NavBar, Icon, Uploader, Dialog, CellGroup, Tab, Tabs, PullRefresh,
   List, RadioGroup, Radio, SwipeCell,Search
} from 'vant';
Vue.use(Form);
Vue.use(Field);
Vue.use(Button);
Vue.use(Toast);
Vue.use(Cell);
Vue.use(NavBar);
Vue.use(Icon)
Vue.use(Uploader)
Vue.use(Dialog)
Vue.use(CellGroup)
Vue.use(Tab)
Vue.use(Tabs)
Vue.use(PullRefresh)
Vue.use(List)
Vue.use(RadioGroup)
Vue.use(Radio)
Vue.use(SwipeCell)
Vue.use(Search)

// 注册头像过滤器
Vue.filter("avatarFilter", function (value) {
  return `http://127.0.0.1:3000${value}`;
});

// 注册日期过滤器
Vue.filter("dateFilter", function (value) {
  const d = new Date(value);
  // 把Date对象转化为本地格式的年月日的形式
  return d.toLocaleDateString();
})

// 注册路由实例
new Vue({
  router: routes,
  render: h => h(App),
}).$mount('#app')
